import { useStore } from "vuex";
import { IViewHooks } from "@/types/interface";
import { checkPermission } from "@/utils/http/utils";

const useView = (props: any): IViewHooks => {
    const store = useStore();
    const rejectFun = {
        hasPermission(key: string){
            debugger
            return checkPermission(store.state.permission as string[], key);
        }
    }

    return {
        ...rejectFun
    };
}

export default useView;